home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / earcd / biz / cloan / pprx_ani.lha / PPRX_AnimPath / AnimPath.pprx next >
Text File  |  1997-02-16  |  47KB  |  1,758 lines

  1. /* Personal Paint Amiga Rexx script - Copyright © 1997 Cloanto Italia srl */
  2.  
  3. /* $VER: AnimPath.pprx 1.3 */
  4.  
  5. /** ENG
  6.  This script can be used to easily create animations with
  7.  moving and transforming objects.
  8.  
  9.  The main requester gives access to the following commands:
  10.  
  11.  - New: the path is cleared and the brush transformations are set
  12.    to their defaults.
  13.  
  14.  - Load: an existing path file can be selected using the file requester;
  15.    this causes the path coordinates, the brush transformation settings
  16.    and the animation settings to be loaded (note: this data
  17.    is stored in ASCII format and can easily be algorithmically
  18.    generated and manipulated by other programs).
  19.  
  20.  - Save: this command writes a path file using the current path data.
  21.  
  22.  - Define Freehand: the mouse can be used to "draw" the path;
  23.    both the direction of the path and the mouse movement speed
  24.    affect the resulting animation: the original direction
  25.    is used to render the frames (the starting point is used
  26.    to place the object in the first frame and the last point
  27.    is used for the last frame) and the drawing speed
  28.    affects the number and the "density" of stored points
  29.    (the slower the speed, the more points, and
  30.    vice versa) and defines the perceived speed of the animation
  31.    (e.g. a path defined with a high initial speed and a slow
  32.    ending speed leads to a corresponding animation).
  33.    Before the mouse button is pressed, the brush is displayed to ease
  34.    positioning in the first frame.
  35.  
  36.  - Define Linear: the mouse can be used to define a linear path
  37.    (simply consisting of a starting point and an ending point);
  38.    unlike the freehand path, this kind of path produces a
  39.    constant-speed animation (equally-spaced intermediate points
  40.    are generated automatically).
  41.  
  42.  - Edit: this command can be used to visually edit the path;
  43.    the "path points" can be dragged with the mouse to change the
  44.    path shape and/or density (speed); the <m> key toggles
  45.    the magnify mode on or off, and the right mouse button or the <Esc> key
  46.    can be pressed to leave the editing mode.
  47.  
  48.  - Move and Resize: the mouse can be used to resize the animation
  49.    path (clicking on the lower right part of the path) or to drag it
  50.    to a new position (clicking on the upper part). This is useful
  51.    to create paths with point outside the screen, which cannot be
  52.    drawn by hand. The <m> key toggles the magnify mode on or off, and
  53.    the right mouse button or the <Esc> key can be pressed
  54.    to exit from the move and resize mode.
  55.  
  56.  - Brush Angle: the Brush Angle requester is used to set
  57.    the number of brush rotations ("Rotation Cycles"), the starting
  58.    ("From Angle") and ending angle ("To Angle"), and the
  59.    rotation direction ("Direction": "Clockwise/Counterclockwise");
  60.    a number of rotations greater than 1 can be used to add
  61.    additional 360° spins in the specified direction.
  62.  
  63.  - Brush Shear: the Brush Shear requester is used to set
  64.    the number of shear cycles ("Shear Cycles"), the starting and
  65.    ending horizontal shear ("From Horizontal", "To Horizontal"),
  66.    and the starting and ending vertical shear ("From Vertical",
  67.    "To Vertical"); if a number of shear cycles greather than 1 is specified,
  68.    the shear factors will move back and forth within the specified
  69.    limits (an odd number of cycles must be used to reach the ending
  70.    shear in the last frame).
  71.  
  72.  - Brush Size: the Brush Size requester is used to set
  73.    the number of resize cycles ("Resize Cycles"), the starting and
  74.    ending horizontal size ("From Horizontal", "To Horizontal",
  75.    in percentage of the original size), and the starting and ending
  76.    vertical size ("From Vertical", "To Vertical");
  77.    if a number of resize cycles greather than 1 is specified,
  78.    the resize factors will move back and forth within the specified
  79.    limits (an odd number of cycles must be used to reach the ending
  80.    size in the last frame).
  81.  
  82.  - Data: the data requester can be used to view the path data
  83.    at a glance (animation, rotation, shear and resize settings,
  84.    followed by the path coordinates).
  85.  
  86.  - Preview: this command can be used to preview the animation;
  87.    when one or more brush effects are involved, the brush image
  88.    is replaced by an outline (the inner arrow points to the top
  89.    of the brush).
  90.  
  91.  The main requester also contains gadgets to set the animation
  92.  frames ("Count"), the recording direction ("Direction":
  93.  "Forward/Backward/Still" - the frame step) and the frame insertion option
  94.  ("Add Frames" - if active, "Count" frames are inserted).
  95.  
  96.  When using freehand paths with no brush effect, the "Count"
  97.  setting should not be set to a number greater than the path points
  98.  (as reported by the Data requester), as this would generate one or more
  99.  duplicate frames.
  100.  
  101.  The bottom gadgets in the main requester can be used to render
  102.  the animation ("Draw", which also terminates the script) or to
  103.  quit the script ("Quit"). A copy of the current path is
  104.  always temporarily stored, so that it can be used when the script is
  105.  run again.
  106.  
  107.  The following program settings affect the animation appearance and
  108.  quality: the current brush (anim-brushes can be used to
  109.  create complex animation effects), the brush handle position,
  110.  the brush paint mode (and the foreground color, if the "Color" mode
  111.  is active) and the "Color average resize" option.
  112. */
  113.  
  114. IF ARG(1, EXISTS) THEN
  115.     PARSE ARG PPPORT
  116. ELSE
  117.     PPPORT = 'PPAINT'
  118.  
  119. IF ~SHOW('P', PPPORT) THEN DO
  120.     IF EXISTS('PPaint:PPaint') THEN DO
  121.         ADDRESS COMMAND 'Run >NIL: PPaint:PPaint'
  122.         DO 30 WHILE ~SHOW('P',PPPORT)
  123.              ADDRESS COMMAND 'Wait >NIL: 1 SEC'
  124.         END
  125.     END
  126.     ELSE DO
  127.         SAY "Personal Paint could not be loaded."
  128.         EXIT 10
  129.     END
  130. END
  131.  
  132. IF ~SHOW('P', PPPORT) THEN DO
  133.     SAY 'Personal Paint Rexx port could not be opened'
  134.     EXIT 10
  135. END
  136.  
  137. ADDRESS VALUE PPPORT
  138. OPTIONS RESULTS
  139. OPTIONS FAILAT 10000
  140.  
  141. Get 'LANG'
  142. IF RESULT = 1 THEN DO        /* Deutsch */
  143.     global.txt_title_menu  = 'Animation Path'            /* *** ENG */
  144.     global.txt_title_new   = 'New Animation Path'
  145.     global.txt_title_load  = 'Load Animation Path'
  146.     global.txt_title_save  = 'Save Animation Path'
  147.     global.txt_title_fhand = 'Define Freehand Path'
  148.     global.txt_title_line  = 'Define Linear Path'
  149.     global.txt_title_edit  = 'Edit Animation Path'
  150.     global.txt_title_movrs = 'Move/Resize Animation Path'
  151.     global.txt_title_brot  = 'Brush Angle'
  152.     global.txt_title_bshr  = 'Brush Shear'
  153.     global.txt_title_bresz = 'Brush Size'
  154.     global.txt_title_pview = 'Preview Animation'
  155.     global.txt_title_draw  = 'Draw Animation'
  156.     global.txt_title_data  = 'Animation Path Data'
  157.  
  158.     global.txt_menu_new    = 'New'
  159.     global.txt_menu_load   = 'Load...'
  160.     global.txt_menu_save   = 'Save...'
  161.     global.txt_menu_fhand  = 'Define Freehand'
  162.     global.txt_menu_line   = 'Define Linear'
  163.     global.txt_menu_edit   = 'Edit'
  164.     global.txt_menu_movrs  = 'Move and Resize'
  165.     global.txt_menu_brot   = 'Brush Angle...'
  166.     global.txt_menu_bshr   = 'Brush Shear...'
  167.     global.txt_menu_bresz  = 'Brush Size...'
  168.     global.txt_menu_data   = 'Data...'
  169.     global.txt_menu_prview = 'Preview'
  170.  
  171.     global.txt_gad_count   = 'C_ount:'
  172.     global.txt_gad_add     = 'Add _Frames:'
  173.     global.txt_gad_addf.0  = 'No'
  174.     global.txt_gad_addf.1  = 'Yes'
  175.     global.txt_gad_direct  = 'Directi_on:'
  176.     global.txt_gad_dirct.0 = 'Forward'
  177.     global.txt_gad_dirct.1 = 'Backward'
  178.     global.txt_gad_dirct.2 = 'Still'
  179.     global.txt_gad_draw    = '_Draw'
  180.     global.txt_gad_quit    = '_Quit'
  181.     global.txt_gad_rotats  = '_Rotation Cycles:'
  182.     global.txt_gad_fromang = '_From Angle:'
  183.     global.txt_gad_toang   = '_To Angle:'
  184.     global.txt_gad_rotdir  = '_Direction:'
  185.     global.txt_gad_rotdr.0 = 'Clockwise'
  186.     global.txt_gad_rotdr.1 = 'Counterclockwise'
  187.     global.txt_gad_shears  = '_Shear Cycles:'
  188.     global.txt_gad_fromshx = '_From Horizontal:'
  189.     global.txt_gad_toshx   = '_To Horizontal:'
  190.     global.txt_gad_fromshy = 'F_rom Vertical:'
  191.     global.txt_gad_toshy   = 'T_o Vertical:'
  192.     global.txt_gad_resizes = 'Re_size Cycles:'
  193.     global.txt_gad_fromrsx = '_From Horizontal (%):'
  194.     global.txt_gad_torsx   = '_To Horizontal (%):'
  195.     global.txt_gad_fromrsy = 'F_rom Vertical (%):'
  196.     global.txt_gad_torsy   = 'T_o Vertical (%):'
  197.     global.txt_msg_points  = 'Points:'
  198.     global.txt_msg_ptype.0 = '(freehand path)'
  199.     global.txt_msg_ptype.1 = '(linear path)'
  200.  
  201.     global.txt_err_oldcl   = 'This script requires a newer_version of Personal Paint'
  202.     global.txt_err_lost    = 'The path will be lost'
  203.     global.txt_err_load    = 'The path file cannot be opened'
  204.     global.txt_err_nopath  = 'No path has been defined'
  205.     global.txt_err_save    = 'The path cannot be saved'
  206.     global.txt_err_nocbsh  = 'Transformation can only be applied to user brushes'
  207.     global.txt_err_notbsh  = 'Transformation cannot be applied: no space for temporary brush'
  208.     global.txt_err_notmem  = 'Not enough memory'
  209. END
  210. ELSE IF RESULT = 2 THEN DO        /* Italiano */
  211.     global.txt_title_menu  = 'Percorso animazione'
  212.     global.txt_title_new   = 'Nuovo percorso animazione'
  213.     global.txt_title_load  = 'Leggere percorso animazione'
  214.     global.txt_title_save  = 'Scrivere percorso animazione'
  215.     global.txt_title_fhand = 'Definire a mano libera'
  216.     global.txt_title_line  = 'Definire lineare'
  217.     global.txt_title_edit  = 'Modificare percorso animazione'
  218.     global.txt_title_movrs = 'Spostare percorso animazione'
  219.     global.txt_title_brot  = 'Angolo pennello'
  220.     global.txt_title_bshr  = 'Inclinazione pennello'
  221.     global.txt_title_bresz = 'Dimensione pennello'
  222.     global.txt_title_pview = 'Anteprima animazione'
  223.     global.txt_title_draw  = 'Creare animazione'
  224.     global.txt_title_data  = 'Dati percorso animazione'
  225.  
  226.     global.txt_menu_new    = 'Nuovo'
  227.     global.txt_menu_load   = 'Leggere...'
  228.     global.txt_menu_save   = 'Scrivere...'
  229.     global.txt_menu_fhand  = 'Definire a mano libera'
  230.     global.txt_menu_line   = 'Definire lineare'
  231.     global.txt_menu_edit   = 'Modificare'
  232.     global.txt_menu_movrs  = 'Spostare e ridimensionare'
  233.     global.txt_menu_brot   = 'Angolo pennello...'
  234.     global.txt_menu_bshr   = 'Inclinazione pennello...'
  235.     global.txt_menu_bresz  = 'Dimensione pennello...'
  236.     global.txt_menu_data   = 'Dati...'
  237.     global.txt_menu_prview = 'Anteprima'
  238.  
  239.     global.txt_gad_count   = 'Pa_ssi:'
  240.     global.txt_gad_add     = 'Aggiunta _fotogrammi:'
  241.     global.txt_gad_addf.0  = 'No'
  242.     global.txt_gad_addf.1  = 'Sì'
  243.     global.txt_gad_direct  = 'Direzi_one:'
  244.     global.txt_gad_dirct.0 = 'Avanti'
  245.     global.txt_gad_dirct.1 = 'Indietro'
  246.     global.txt_gad_dirct.2 = 'Fermo'
  247.     global.txt_gad_draw    = '_Animare'
  248.     global.txt_gad_quit    = '_Uscire'
  249.     global.txt_gad_rotats  = 'Cicli _rotazione:'
  250.     global.txt_gad_fromang = '_Da angolo:'
  251.     global.txt_gad_toang   = 'Ad a_ngolo:'
  252.     global.txt_gad_rotdir  = '_Senso:'
  253.     global.txt_gad_rotdr.0 = 'Orario'
  254.     global.txt_gad_rotdr.1 = 'Antiorario'
  255.     global.txt_gad_shears  = 'Cicli _inclinazione:'
  256.     global.txt_gad_fromshx = '_Da orizzontale:'
  257.     global.txt_gad_toshx   = 'A ori_zzontale:'
  258.     global.txt_gad_fromshy = 'Da _verticale:'
  259.     global.txt_gad_toshy   = 'A ver_ticale:'
  260.     global.txt_gad_resizes = 'Cicli _ridimensionamento:'
  261.     global.txt_gad_fromrsx = '_Da orizzontale (%):'
  262.     global.txt_gad_torsx   = 'A ori_zzontale (%):'
  263.     global.txt_gad_fromrsy = 'Da _verticale (%):'
  264.     global.txt_gad_torsy   = 'A ver_ticale (%):'
  265.     global.txt_msg_points  = 'Punti:'
  266.     global.txt_msg_ptype.0 = '(percorso a mano libera)'
  267.     global.txt_msg_ptype.1 = '(percorso lineare)'
  268.  
  269.     global.txt_err_oldcl   = 'Questa procedura richiede_una versione più recente_di Personal Paint'
  270.     global.txt_err_lost    = 'Il percorso sarà cancellato'
  271.     global.txt_err_load    = 'Il file non può essere aperto'
  272.     global.txt_err_nopath  = 'Non è stato definito alcun percorso'
  273.     global.txt_err_save    = 'Il percorso non può essere scritto'
  274.     global.txt_err_nocbsh  = 'Le trasformazioni non possono essere applicate ai pennelli predefiniti'
  275.     global.txt_err_notbsh  = 'Le trasformationi non possono essere applicate: non vi è spazio per il pennello temporaneo'
  276.     global.txt_err_notmem  = 'Memoria insufficiente'
  277. END
  278. ELSE DO                /* English */
  279.     global.txt_title_menu  = 'Animation Path'
  280.     global.txt_title_new   = 'New Animation Path'
  281.     global.txt_title_load  = 'Load Animation Path'
  282.     global.txt_title_save  = 'Save Animation Path'
  283.     global.txt_title_fhand = 'Define Freehand Path'
  284.     global.txt_title_line  = 'Define Linear Path'
  285.     global.txt_title_edit  = 'Edit Animation Path'
  286.     global.txt_title_movrs = 'Move/Resize Animation Path'
  287.     global.txt_title_brot  = 'Brush Angle'
  288.     global.txt_title_bshr  = 'Brush Shear'
  289.     global.txt_title_bresz = 'Brush Size'
  290.     global.txt_title_pview = 'Preview Animation'
  291.     global.txt_title_draw  = 'Draw Animation'
  292.     global.txt_title_data  = 'Animation Path Data'
  293.  
  294.     global.txt_menu_new    = 'New'
  295.     global.txt_menu_load   = 'Load...'
  296.     global.txt_menu_save   = 'Save...'
  297.     global.txt_menu_fhand  = 'Define Freehand'
  298.     global.txt_menu_line   = 'Define Linear'
  299.     global.txt_menu_edit   = 'Edit'
  300.     global.txt_menu_movrs  = 'Move and Resize'
  301.     global.txt_menu_brot   = 'Brush Angle...'
  302.     global.txt_menu_bshr   = 'Brush Shear...'
  303.     global.txt_menu_bresz  = 'Brush Size...'
  304.     global.txt_menu_data   = 'Data...'
  305.     global.txt_menu_prview = 'Preview'
  306.  
  307.     global.txt_gad_count   = 'C_ount:'
  308.     global.txt_gad_add     = 'Add _Frames:'
  309.     global.txt_gad_addf.0  = 'No'
  310.     global.txt_gad_addf.1  = 'Yes'
  311.     global.txt_gad_direct  = 'Directi_on:'
  312.     global.txt_gad_dirct.0 = 'Forward'
  313.     global.txt_gad_dirct.1 = 'Backward'
  314.     global.txt_gad_dirct.2 = 'Still'
  315.     global.txt_gad_draw    = '_Draw'
  316.     global.txt_gad_quit    = '_Quit'
  317.     global.txt_gad_rotats  = '_Rotation Cycles:'
  318.     global.txt_gad_fromang = '_From Angle:'
  319.     global.txt_gad_toang   = '_To Angle:'
  320.     global.txt_gad_rotdir  = '_Direction:'
  321.     global.txt_gad_rotdr.0 = 'Clockwise'
  322.     global.txt_gad_rotdr.1 = 'Counterclockwise'
  323.     global.txt_gad_shears  = '_Shear Cycles:'
  324.     global.txt_gad_fromshx = '_From Horizontal:'
  325.     global.txt_gad_toshx   = '_To Horizontal:'
  326.     global.txt_gad_fromshy = 'F_rom Vertical:'
  327.     global.txt_gad_toshy   = 'T_o Vertical:'
  328.     global.txt_gad_resizes = 'Re_size Cycles:'
  329.     global.txt_gad_fromrsx = '_From Horizontal (%):'
  330.     global.txt_gad_torsx   = '_To Horizontal (%):'
  331.     global.txt_gad_fromrsy = 'F_rom Vertical (%):'
  332.     global.txt_gad_torsy   = 'T_o Vertical (%):'
  333.     global.txt_msg_points  = 'Points:'
  334.     global.txt_msg_ptype.0 = '(freehand path)'
  335.     global.txt_msg_ptype.1 = '(linear path)'
  336.  
  337.     global.txt_err_oldcl   = 'This script requires a newer_version of Personal Paint'
  338.     global.txt_err_lost    = 'The path will be lost'
  339.     global.txt_err_load    = 'The path file cannot be opened'
  340.     global.txt_err_nopath  = 'No path has been defined'
  341.     global.txt_err_save    = 'The path cannot be saved'
  342.     global.txt_err_nocbsh  = 'Transformation can only be applied to user brushes'
  343.     global.txt_err_notbsh  = 'Transformation cannot be applied: no space for temporary brush'
  344.     global.txt_err_notmem  = 'Not enough memory'
  345. END
  346.  
  347. Version 'REXX'
  348. IF RESULT < 7 THEN DO
  349.     RequestNotify 'PROMPT "'global.txt_err_oldcl'"'
  350.     EXIT 10
  351. END
  352.  
  353. tmpname = 'T:PP_AnimPath'
  354. global.pathdisp = 1
  355.  
  356. CALL DefData
  357.  
  358. LockGUI
  359.  
  360. GetPaintMode
  361. global.savepmode = RESULT
  362.  
  363. GetBrushAttributes 'WIDTH'
  364. global.bshw = RESULT
  365. GetBrushAttributes 'HEIGHT'
  366. global.bshh = RESULT
  367. GetBrushAttributes 'HANDLEX'
  368. global.bshhx = RESULT
  369. GetBrushAttributes 'HANDLEY'
  370. global.bshhy = RESULT
  371.  
  372. GetBrushAttributes 'FRAMES'
  373. global.savebshfr = RESULT
  374. GetBrushAttributes 'FRAMEPOSITION'
  375. global.savebshfp = RESULT
  376. GetBrushNumber
  377. global.savebshnum = RESULT
  378. GetCurrentBrush
  379. global.savebsh = RESULT
  380.  
  381. SetCurrentBrush 'UNUSED'
  382. IF RC ~= 0 THEN
  383.     global.tbshnum = 0
  384. ELSE DO
  385.     GetBrushNumber
  386.     global.tbshnum = RESULT
  387. END
  388.  
  389. SetCurrentBrush 'RECTANGULAR WIDTH 1 HEIGHT 1'
  390.  
  391. GetPen 'FOREGROUND'
  392. global.savepen = RESULT
  393. Get 'COLORS'
  394. global.xorpen = RESULT-1
  395. SetPen 'FOREGROUND' global.xorpen
  396.  
  397. Get 'BARS'
  398. savebars = RESULT
  399. Set '"BARS=0"'
  400.  
  401. Get 'GCLIP'
  402. saveclip = RESULT
  403. Set '"GCLIP=0"'
  404.  
  405. Get 'COORD'
  406. savecoord = RESULT
  407. Set '"COORD=0"'
  408.  
  409. DisableTools
  410. UnlockGUI
  411.  
  412. SIGNAL ON Break_C
  413.  
  414. /* load last used path and display it */
  415. CALL LoadPathFile(tmpname)
  416. CALL XorPath
  417.  
  418. Get 'SCREENH'
  419. IF RESULT < 206 THEN
  420.     mrows = 11
  421. ELSE
  422.     mrows = 12
  423.  
  424. command = 0
  425. DO FOREVER
  426.     Request '"'global.txt_title_menu'" COMPACT ',
  427.             '"LIST ACTION = , 12, 'command', 20, 'mrows', ',
  428.             ' ""'global.txt_menu_new'"", ',
  429.             ' ""'global.txt_menu_load'"", ',
  430.             ' ""'global.txt_menu_save'"", ',
  431.             ' ""'global.txt_menu_fhand'"", ',
  432.             ' ""'global.txt_menu_line'"", ',
  433.             ' ""'global.txt_menu_edit'"", ',
  434.             ' ""'global.txt_menu_movrs'"", ',
  435.             ' ""'global.txt_menu_brot'"", ',
  436.             ' ""'global.txt_menu_bshr'"", ',
  437.             ' ""'global.txt_menu_bresz'"", ',
  438.             ' ""'global.txt_menu_data'"", ',
  439.             ' ""'global.txt_menu_prview'"" ',
  440.             ' VSPACE = 4 ',
  441.             ' INTSTR = ""'global.txt_gad_count'"", 1, 32000, 'global.count' ',
  442.             ' VSPACE = 2 ',
  443.             ' CYCLE = ""'global.txt_gad_direct'"", 3, 'global.direct', ""'global.txt_gad_dirct.0'"", ""'global.txt_gad_dirct.1'"", ""'global.txt_gad_dirct.2'"" ' ||,
  444.             ' VSPACE = 2 ',
  445.             ' CHECK = ""'global.txt_gad_add'"", 'global.add' ' ||,
  446.             ' VSPACE = 2 ',
  447.             ' ACTION = ""'global.txt_gad_draw'"" ',
  448.             ' ACTION = ""'global.txt_gad_quit'"" "'
  449.     IF RC = 0 THEN DO
  450.         command = RESULT.1
  451.         global.count = RESULT.2
  452.         global.direct = RESULT.3
  453.         global.add = RESULT.4
  454.  
  455.         IF RESULT = 1 THEN DO    /* Draw */
  456.             IF DrawIt() THEN
  457.                 LEAVE
  458.         END
  459.         ELSE IF RESULT = 2 THEN    /* Quit */
  460.             LEAVE
  461.         ELSE DO     /* Command List */
  462.             IF      command = 0 THEN CALL NewPath
  463.             ELSE IF command = 1 THEN CALL LoadPath
  464.             ELSE IF command = 2 THEN CALL SavePath
  465.             ELSE IF command = 3 THEN CALL DefFreehand
  466.             ELSE IF command = 4 THEN CALL DefLinear
  467.             ELSE IF command = 5 THEN CALL EditPath
  468.             ELSE IF command = 6 THEN CALL MoveResizePath
  469.             ELSE IF command = 7 THEN CALL RotSettings
  470.             ELSE IF command = 8 THEN CALL ShearSettings
  471.             ELSE IF command = 9 THEN CALL ResizeSettings
  472.             ELSE IF command = 10 THEN CALL DisplayData
  473.             ELSE IF command = 11 THEN CALL PreviewPath
  474.         END
  475.     END
  476. END
  477.  
  478. CALL SavePathFile(tmpname)
  479. CALL Break_C
  480.  
  481. EXIT 0
  482.  
  483.  
  484.  
  485.  
  486.  
  487. DefData: PROCEDURE EXPOSE global.
  488.  
  489.     global.count  = 10
  490.     global.direct = 0
  491.     global.add    = 1
  492.  
  493.     global.rotats  = 1
  494.     global.fromang = 0 * 10000
  495.     global.toang   = 0 * 10000
  496.     global.rotdir  = 0
  497.  
  498.     global.shears  = 1
  499.     global.fromshx = 0
  500.     global.toshx   = 0
  501.     global.fromshy = 0
  502.     global.toshy   = 0
  503.  
  504.     global.resizes = 1
  505.     global.fromrsx = 100 * 10000
  506.     global.torsx   = 100 * 10000
  507.     global.fromrsy = 100 * 10000
  508.     global.torsy   = 100 * 10000
  509.  
  510.     global.points = 0
  511.     DROP global.xcoord. global.ycoord.
  512.  
  513.     RETURN
  514.  
  515.  
  516.  
  517.  
  518. NewPath: PROCEDURE EXPOSE global.
  519.  
  520.     RequestResponse 'TITLE "'global.txt_title_new'" PROMPT "'global.txt_err_lost'"'
  521.     IF RC = 0 THEN DO
  522.         IF global.points > 0 THEN
  523.             CALL XorPath
  524.  
  525.         CALL DefData
  526.     END
  527.  
  528.     RETURN
  529.  
  530.  
  531.  
  532.  
  533. LoadPathFile: PROCEDURE EXPOSE global.
  534.  
  535.     ok = 0
  536.     IF OPEN('pfile', ARG(1), 'R') THEN DO
  537.         LockGUI
  538.         IF READLN('pfile') = 'PPAINT PATH' THEN DO
  539.             IF READLN('pfile') = '1' THEN DO
  540.                 global.count  = READLN('pfile')
  541.                 global.direct = READLN('pfile')
  542.                 global.add    = READLN('pfile')
  543.  
  544.                 global.rotats  = READLN('pfile')
  545.                 global.fromang = READLN('pfile')
  546.                 global.toang   = READLN('pfile')
  547.                 global.rotdir  = READLN('pfile')
  548.  
  549.                 global.shears  = READLN('pfile')
  550.                 global.fromshx = READLN('pfile')
  551.                 global.toshx   = READLN('pfile')
  552.                 global.fromshy = READLN('pfile')
  553.                 global.toshy   = READLN('pfile')
  554.  
  555.                 global.resizes = READLN('pfile')
  556.                 global.fromrsx = READLN('pfile')
  557.                 global.torsx   = READLN('pfile')
  558.                 global.fromrsy = READLN('pfile')
  559.                 global.torsy   = READLN('pfile')
  560.  
  561.                 global.points = READLN('pfile')
  562.  
  563.                 DO point = 0 FOR global.points
  564.                     xy = READLN('pfile')
  565.                     PARSE VAR xy global.xcoord.point global.ycoord.point .
  566.                 END
  567.                 ok = 1
  568.             END
  569.         END
  570.         CALL CLOSE('pfile')
  571.         UnlockGUI
  572.     END
  573.  
  574.     RETURN ok
  575.  
  576.  
  577.  
  578.  
  579. LoadPath: PROCEDURE EXPOSE global.
  580.  
  581.     RequestFile 'TITLE "'global.txt_title_load'"'
  582.     IF RC = 0 THEN DO
  583.         PARSE VALUE RESULT WITH '"' pfilename '"'
  584.  
  585.         IF global.points > 0 THEN DO
  586.             CALL XorPath
  587.             CALL DefData
  588.         END
  589.  
  590.         IF LoadPathFile(pfilename) THEN
  591.             CALL XorPath
  592.         ELSE DO
  593.             CALL DefData
  594.             RequestNotify 'TITLE "'global.txt_title_load'" PROMPT "'global.txt_err_load'"'
  595.         END
  596.     END
  597.  
  598.     RETURN
  599.  
  600.  
  601.  
  602.  
  603. SavePathFile: PROCEDURE EXPOSE global.
  604.  
  605.     ok = 0
  606.     IF OPEN('pfile', ARG(1), 'W') THEN DO
  607.         LockGUI
  608.         CALL WRITELN('pfile', 'PPAINT PATH')
  609.         CALL WRITELN('pfile', '1')        /* version */
  610.  
  611.         CALL WRITELN('pfile', global.count)
  612.         CALL WRITELN('pfile', global.direct)
  613.         CALL WRITELN('pfile', global.add)
  614.  
  615.         CALL WRITELN('pfile', global.rotats)
  616.         CALL WRITELN('pfile', global.fromang)
  617.         CALL WRITELN('pfile', global.toang)
  618.         CALL WRITELN('pfile', global.rotdir)
  619.  
  620.         CALL WRITELN('pfile', global.shears)
  621.         CALL WRITELN('pfile', global.fromshx)
  622.         CALL WRITELN('pfile', global.toshx)
  623.         CALL WRITELN('pfile', global.fromshy)
  624.         CALL WRITELN('pfile', global.toshy)
  625.  
  626.         CALL WRITELN('pfile', global.resizes)
  627.         CALL WRITELN('pfile', global.fromrsx)
  628.         CALL WRITELN('pfile', global.torsx)
  629.         CALL WRITELN('pfile', global.fromrsy)
  630.         CALL WRITELN('pfile', global.torsy)
  631.  
  632.         CALL WRITELN('pfile', global.points)
  633.  
  634.         DO point = 0 FOR global.points
  635.             CALL WRITELN('pfile', global.xcoord.point' 'global.ycoord.point)
  636.         END
  637.         ok = 1
  638.         CALL CLOSE('pfile')
  639.         UnlockGUI
  640.     END
  641.  
  642.     RETURN ok
  643.  
  644.  
  645.  
  646.  
  647. SavePath: PROCEDURE EXPOSE global.
  648.  
  649.     IF global.points = 0 THEN DO
  650.         RequestNotify 'TITLE "'global.txt_title_save'" PROMPT "'global.txt_err_nopath'"'
  651.         RETURN
  652.     END
  653.  
  654.     RequestFile 'TITLE "'global.txt_title_save'" SAVEMODE'
  655.     IF RC = 0 THEN DO
  656.         PARSE VALUE RESULT WITH '"' pfilename '"'
  657.         IF ~SavePathFile(pfilename) THEN
  658.             RequestNotify 'TITLE "'global.txt_title_save'" PROMPT "'global.txt_err_save'"'
  659.     END
  660.  
  661.     RETURN
  662.  
  663.  
  664.  
  665.  
  666. XorVertex: PROCEDURE EXPOSE global.
  667.  
  668.     point = ARG(1)
  669.  
  670.     IF point > 0 THEN DO
  671.         IF point = 1 THEN
  672.             nfp = ''
  673.         ELSE
  674.             nfp = 'NOFIRSTPIXEL'
  675.         ppt = point - 1
  676.         DrawLine global.xcoord.ppt global.ycoord.ppt global.xcoord.point global.ycoord.point 'COMPLEMENT' nfp
  677.     END
  678.     npt = point + 1
  679.     IF npt < global.points THEN DO
  680.         IF point = 0 THEN
  681.             nfp = ''
  682.         ELSE
  683.             nfp = 'NOFIRSTPIXEL'
  684.         DrawLine global.xcoord.point global.ycoord.point global.xcoord.npt global.ycoord.npt 'COMPLEMENT' nfp
  685.     END
  686.  
  687.     RETURN
  688.  
  689.  
  690.  
  691.  
  692. EditPath: PROCEDURE EXPOSE global.
  693.  
  694.     IF global.points = 0 THEN DO
  695.         RequestNotify 'TITLE "'global.txt_title_edit'" PROMPT "'global.txt_err_nopath'"'
  696.         RETURN
  697.     END
  698.  
  699.     SetPointer 'DATA ',
  700.         '"0xC000,0x7000,0x3C00,0x3F00,0x1F00,0x1E00,0x0B00,0x0980,',
  701.         ' 0x0080,0x0000,0x0018,0x003C,0x0018,',
  702.         ' 0x4000,0xB000,0x4C00,0x4300,0x2000,0x2200,0x1500,0x1280,',
  703.         ' 0x0100,0x0000,0x0028,0x0044,0x0028" ',
  704.         'HEIGHT 13 OFFSETX -1 OFFSETY 0'
  705.  
  706.     DO FOREVER
  707.         WaitForClick 'DOWN POINT SHOWBRUSH'
  708.         IF RC = 0 THEN DO
  709.             PARSE VAR RESULT button xp yp .
  710.  
  711.             IF button > 1 THEN
  712.                 LEAVE
  713.             mindist = 30000
  714.             DO point = 0 FOR global.points
  715.                 GetDistance xp yp global.xcoord.point global.ycoord.point 'IMAGERATIO'
  716.                 IF RESULT < mindist THEN DO
  717.                     mindist = RESULT
  718.                     mindpt = point
  719.                 END
  720.             END
  721.             point = mindpt
  722.             prev_xp = xp
  723.             prev_yp = yp
  724.             drawn = 0
  725.  
  726.             DO FOREVER
  727.                 GetMousePosition
  728.                 PARSE VAR RESULT xp yp .
  729.  
  730.                 IF xp ~= prev_xp | yp ~= prev_yp | ~drawn THEN DO
  731.                     CALL XorVertex(point)
  732.                     global.xcoord.point = xp
  733.                     global.ycoord.point = yp
  734.                     CALL XorVertex(point)
  735.  
  736.                     prev_xp = xp
  737.                     prev_yp = yp
  738.                     drawn = 1
  739.                 END
  740.                 ELSE WaitForEvent
  741.  
  742.                 GetMouseButton
  743.                 IF RESULT = 0 THEN
  744.                     LEAVE
  745.             END
  746.         END
  747.         ELSE LEAVE
  748.     END
  749.     SetPointer
  750.     RETURN
  751.  
  752.  
  753.  
  754.  
  755. MoveResizePath: PROCEDURE EXPOSE global.
  756.  
  757.     IF global.points = 0 THEN DO
  758.         RequestNotify 'TITLE "'global.txt_title_movrs'" PROMPT "'global.txt_err_nopath'"'
  759.         RETURN
  760.     END
  761.  
  762.     SetPointer 'DATA ',
  763.         '"0xC000,0x7000,0x3C00,0x3F00,0x1FC0,0x1FC0,0x0F00,0x0D80,',
  764.         ' 0x04C0,0x0460,0x0020,',
  765.         ' 0x4000,0xB000,0x4C00,0x4300,0x20C0,0x2000,0x1100,0x1280,',
  766.         ' 0x0940,0x08A0,0x0040" ',
  767.         'HEIGHT 11 OFFSETX -1 OFFSETY 0'
  768.     minx = 32000
  769.     miny = 32000
  770.     maxx = -32000
  771.     maxy = -32000
  772.     DO point = 0 FOR global.points
  773.         IF global.xcoord.point < minx THEN minx = global.xcoord.point
  774.         IF global.xcoord.point > maxx THEN maxx = global.xcoord.point
  775.         IF global.ycoord.point < miny THEN miny = global.ycoord.point
  776.         IF global.ycoord.point > maxy THEN maxy = global.ycoord.point
  777.  
  778.         origxc.point = global.xcoord.point
  779.         origyc.point = global.ycoord.point
  780.     END
  781.     w1 = maxx - minx
  782.     h1 = maxy - miny
  783.     minx00 = minx
  784.     miny00 = miny
  785.     w100 = w1
  786.     h100 = h1
  787.  
  788.     DO FOREVER
  789.         WaitForClick 'DOWN POINT'
  790.         IF RC = 0 THEN DO
  791.             PARSE VAR RESULT button xp yp .
  792.  
  793.             IF button > 1 THEN
  794.                 LEAVE
  795.             resize = (xp > minx+w1/2 & yp > miny+h1/2)
  796.             IF resize THEN DO
  797.                 SetPointer 'DATA ',
  798.                     '"0xC000,0x7000,0x3C00,0x3F00,0x1F00,0x1E00,0x0B00,0x0980,',
  799.                     ' 0x00E0,0x00A0,0x00FE,0x0022,0x0022,0x0022,0x003E,',
  800.                     ' 0x4000,0xB000,0x4C00,0x4300,0x2000,0x2200,0x1500,0x1280,',
  801.                     ' 0x0100,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000" ',
  802.                     'HEIGHT 15 OFFSETX -1 OFFSETY 0'
  803.                 w10 = w1
  804.                 h10 = h1
  805.             END
  806.             ELSE DO
  807.                 minx0 = minx
  808.                 miny0 = miny
  809.             END
  810.             CALL XorPath
  811.             DrawRectangle minx miny maxx maxy 'COMPLEMENT'
  812.             prev_xp = xp
  813.             prev_yp = yp
  814.  
  815.             DO FOREVER
  816.                 GetMousePosition
  817.                 PARSE VAR RESULT xp yp .
  818.  
  819.                 IF xp ~= prev_xp | yp ~= prev_yp THEN DO
  820.                     DrawRectangle minx miny maxx maxy 'COMPLEMENT'
  821.                     IF resize THEN DO
  822.                         w1 = w1 + (xp - prev_xp)
  823.                         h1 = h1 + (yp - prev_yp)
  824.                         IF w1 < 1 THEN w1 = 1
  825.                         IF h1 < 1 THEN h1 = 1
  826.                         maxx = minx + w1
  827.                         maxy = miny + h1
  828.                     END
  829.                     ELSE DO
  830.                         minx = minx + (xp - prev_xp)
  831.                         miny = miny + (yp - prev_yp)
  832.                         maxx = minx + w1
  833.                         maxy = miny + h1
  834.                     END
  835.                     DrawRectangle minx miny maxx maxy 'COMPLEMENT'
  836.                     prev_xp = xp
  837.                     prev_yp = yp
  838.                 END
  839.                 ELSE WaitForEvent
  840.  
  841.                 GetMouseButton
  842.                 IF RESULT = 0 THEN
  843.                     LEAVE
  844.             END
  845.  
  846.             DrawRectangle minx miny maxx maxy 'COMPLEMENT'
  847.             IF resize THEN DO
  848.                 IF w10 ~= w1 | h10 ~= h1 THEN DO
  849.                     mx = w1 / w100
  850.                     my = h1 / h100
  851.                     DO point = 0 FOR global.points
  852.                         global.xcoord.point = minx + TRUNC((origxc.point - minx00) * mx)
  853.                         global.ycoord.point = miny + TRUNC((origyc.point - miny00) * my)
  854.                     END
  855.                 END
  856.                 SetPointer 'DATA ',
  857.                     '"0xC000,0x7000,0x3C00,0x3F00,0x1FC0,0x1FC0,0x0F00,0x0D80,',
  858.                     ' 0x04C0,0x0460,0x0020,',
  859.                     ' 0x4000,0xB000,0x4C00,0x4300,0x20C0,0x2000,0x1100,0x1280,',
  860.                     ' 0x0940,0x08A0,0x0040" ',
  861.                     'HEIGHT 11 OFFSETX -1 OFFSETY 0'
  862.             END
  863.             ELSE DO
  864.                 IF minx ~= minx0 | miny ~= miny0 THEN DO
  865.                     dx = minx - minx0
  866.                     dy = miny - miny0
  867.                     DO point = 0 FOR global.points
  868.                         global.xcoord.point = global.xcoord.point + dx
  869.                         global.ycoord.point = global.ycoord.point + dy
  870.                     END
  871.                 END
  872.             END
  873.             CALL XorPath
  874.         END
  875.         ELSE LEAVE
  876.     END
  877.     SetPointer
  878.  
  879.     RETURN
  880.  
  881.  
  882.  
  883.  
  884. SetFirstBrush: PROCEDURE EXPOSE global.
  885.  
  886.     IF global.fromang = 0 & global.fromshx = 0 & global.fromshy = 0 & ,
  887.          global.fromrsx = 1000000 & global.fromrsy = 1000000 THEN
  888.         SetCurrentBrush global.savebsh
  889.     ELSE DO
  890.         SetCurrentBrush 'BRUSH' global.tbshnum
  891.         IF RC ~= 0 THEN
  892.             RETURN
  893.         CopyBrush global.savebshnum 'NOFRAMES'
  894.         IF RC ~= 0 THEN
  895.             RETURN
  896.  
  897.         IF global.fromang ~= 0 THEN DO
  898.             RotateBrush TRUNC(global.fromang / 10 + 0.5) 'NOPROGRESS'
  899.             IF RC ~= 0 THEN
  900.                 RETURN
  901.         END
  902.         IF global.fromshx ~= 0 | global.fromshy ~= 0 THEN DO
  903.             shearx = TRUNC(global.fromshx + 0.5 * SIGN(global.fromshx))
  904.             sheary = TRUNC(global.fromshy + 0.5 * SIGN(global.fromshy))
  905.             ShearBrush shearx sheary 'NOPROGRESS'
  906.             IF RC ~= 0 THEN
  907.                 RETURN
  908.         END
  909.  
  910.         IF global.fromrsx ~= 1000000 | global.fromrsy ~= 1000000 THEN DO
  911.             GetBrushAttributes 'WIDTH'
  912.             w = TRUNC(RESULT * (global.fromrsx / 1000000) + 0.5)
  913.             GetBrushAttributes 'HEIGHT'
  914.             h = TRUNC(RESULT * (global.fromrsy / 1000000) + 0.5)
  915.             IF w < 1 THEN w = 1
  916.             IF h < 1 THEN h = 1
  917.             SetBrushAttributes 'WIDTH' w 'HEIGHT' h 'NOPROGRESS'
  918.             IF RC ~= 0 THEN
  919.                 RETURN
  920.         END
  921.     END
  922.     SetPaintMode global.savepmode
  923.     SetPen 'FOREGROUND' global.savepen
  924.  
  925.     RETURN
  926.  
  927.  
  928.  
  929.  
  930. DefFreehand: PROCEDURE EXPOSE global.
  931.  
  932.     IF global.points > 0 THEN DO
  933.         CALL XorPath
  934.         DROP global.xcoord. global.ycoord.
  935.         global.points = 0
  936.     END
  937.  
  938.     LockGUI
  939.     CALL SetFirstBrush
  940.     UnlockGUI
  941.  
  942.     button = 0
  943.     WaitForClick 'DOWN POINT SHOWBRUSH'
  944.     IF RC = 0 THEN
  945.         PARSE VAR RESULT button x0 y0 .
  946.  
  947.     SetCurrentBrush 'RECTANGULAR WIDTH 1 HEIGHT 1'
  948.     SetPen 'FOREGROUND' global.xorpen
  949.  
  950.     IF button > 0 THEN DO
  951.         prev_xp = x0
  952.         prev_yp = y0
  953.         global.xcoord.0 = x0
  954.         global.ycoord.0 = y0
  955.         point = 1
  956.  
  957.         DO FOREVER
  958.             GetMousePosition
  959.             PARSE VAR RESULT xp yp .
  960.  
  961.             IF xp ~= prev_xp | yp ~= prev_yp THEN DO
  962.                 IF point = 1 THEN
  963.                     nfp = ''
  964.                 ELSE
  965.                     nfp = 'NOFIRSTPIXEL'
  966.                 DrawLine prev_xp prev_yp xp yp 'COMPLEMENT' nfp
  967.  
  968.                 global.xcoord.point = xp
  969.                 global.ycoord.point = yp
  970.                 point = point + 1
  971.  
  972.                 prev_xp = xp
  973.                 prev_yp = yp
  974.             END
  975.             ELSE WaitForEvent
  976.  
  977.             GetMouseButton
  978.             IF RESULT ~= button THEN
  979.                 LEAVE
  980.         END
  981.         IF point = 1 THEN DO
  982.             point = 2
  983.             global.xcoord.1 = global.xcoord.0
  984.             global.ycoord.1 = global.ycoord.0
  985.         END
  986.         global.points = point
  987.     END
  988.  
  989.     RETURN
  990.  
  991.  
  992.  
  993.  
  994. DefLinear: PROCEDURE EXPOSE global.
  995.  
  996.     IF global.points > 0 THEN DO
  997.         CALL XorPath
  998.         DROP global.xcoord. global.ycoord.
  999.         global.points = 0
  1000.     END
  1001.  
  1002.     LockGUI
  1003.     CALL SetFirstBrush
  1004.     UnlockGUI
  1005.  
  1006.     button = 0
  1007.     WaitForClick 'DOWN POINT SHOWBRUSH'
  1008.     IF RC = 0 THEN
  1009.         PARSE VAR RESULT button x0 y0 .
  1010.  
  1011.     SetCurrentBrush 'RECTANGULAR WIDTH 1 HEIGHT 1'
  1012.     SetPen 'FOREGROUND' global.xorpen
  1013.  
  1014.     IF button > 0 THEN DO
  1015.         prev_xp = x0
  1016.         prev_yp = y0
  1017.         global.xcoord.0 = x0
  1018.         global.ycoord.0 = y0
  1019.         drawn = 0
  1020.  
  1021.         DO FOREVER
  1022.             GetMousePosition
  1023.             PARSE VAR RESULT xp yp .
  1024.  
  1025.             IF xp ~= prev_xp | yp ~= prev_yp | ~drawn THEN DO
  1026.                 IF drawn THEN
  1027.                     Undo
  1028.                 DrawLine x0 y0 xp yp 'COMPLEMENT'
  1029.  
  1030.                 global.xcoord.1 = xp
  1031.                 global.ycoord.1 = yp
  1032.                 prev_xp = xp
  1033.                 prev_yp = yp
  1034.                 drawn = 1
  1035.             END
  1036.             ELSE WaitForEvent
  1037.  
  1038.             GetMouseButton
  1039.             IF RESULT ~= button THEN
  1040.                 LEAVE
  1041.         END
  1042.         global.points = 2
  1043.     END
  1044.  
  1045.     RETURN
  1046.  
  1047.  
  1048.  
  1049.  
  1050. InitStep: PROCEDURE EXPOSE global.
  1051.  
  1052.     IF global.points = 2 THEN DO
  1053.         IF global.count > 1 THEN DO
  1054.             global.line_xs = (global.xcoord.1 - global.xcoord.0) / (global.count - 1)
  1055.             global.line_ys = (global.ycoord.1 - global.ycoord.0) / (global.count - 1)
  1056.         END
  1057.         ELSE DO
  1058.             global.line_xs = 0
  1059.             global.line_ys = 0
  1060.         END
  1061.         global.line_xp = global.xcoord.0
  1062.         global.line_yp = global.ycoord.0
  1063.     END
  1064.     ELSE DO
  1065.         global.point_s = global.points / global.count
  1066.         global.point_p = 0
  1067.     END
  1068.  
  1069.     IF global.fromang ~= global.toang | global.rotats > 1 THEN DO
  1070.         global.do_rot = 1
  1071.         IF global.fromang > global.toang & global.rotdir = 0 THEN
  1072.             rotdeg = (3600000 - global.fromang) + global.toang
  1073.         ELSE IF global.fromang < global.toang & global.rotdir = 1 THEN
  1074.             rotdeg = global.fromang + (3600000 - global.toang)
  1075.         ELSE
  1076.             rotdeg = ABS(global.toang - global.fromang)
  1077.  
  1078.         rotdeg = rotdeg + ((global.rotats - 1) * 3600000)
  1079.         IF global.count > 1 THEN
  1080.             global.rot_step =    rotdeg / (global.count - 1)
  1081.         ELSE
  1082.             global.rot_step =    0
  1083.         IF global.rotdir > 0 THEN
  1084.             global.rot_step = -global.rot_step
  1085.     END
  1086.     ELSE
  1087.         global.do_rot = 0
  1088.     global.rot_ang = global.fromang
  1089.  
  1090.     IF global.fromshx ~= global.toshx | global.fromshy ~= global.toshy | global.shears > 1 THEN DO
  1091.         global.do_shear = 1
  1092.         shearx = ABS(global.toshx - global.fromshx)
  1093.         IF global.count > 1 THEN
  1094.             global.shear_sx =    (shearx * global.shears) / (global.count - 1)
  1095.         ELSE
  1096.             global.shear_sx =    0
  1097.         IF global.toshx < global.fromshx THEN
  1098.             global.shear_sx = -global.shear_sx
  1099.         global.min_shx = MIN(global.fromshx, global.toshx)
  1100.         global.max_shx = MAX(global.fromshx, global.toshx)
  1101.  
  1102.         sheary = ABS(global.toshy - global.fromshy)
  1103.         IF global.count > 1 THEN
  1104.             global.shear_sy =    (sheary * global.shears) / (global.count - 1)
  1105.         ELSE
  1106.             global.shear_sy =    0
  1107.         IF global.toshy < global.fromshy THEN
  1108.             global.shear_sy = -global.shear_sy
  1109.         global.min_shy = MIN(global.fromshy, global.toshy)
  1110.         global.max_shy = MAX(global.fromshy, global.toshy)
  1111.     END
  1112.     ELSE
  1113.         global.do_shear = 0
  1114.     global.shear_x = global.fromshx
  1115.     global.shear_y = global.fromshy
  1116.  
  1117.     IF global.fromrsx ~= global.torsx | global.fromrsy ~= global.torsy | global.resizes > 1 THEN DO
  1118.         global.do_resize = 1
  1119.         resizex = ABS(global.torsx - global.fromrsx)
  1120.         IF global.count > 1 THEN
  1121.             global.resize_sx = (resizex * global.resizes) / (global.count - 1)
  1122.         ELSE
  1123.             global.resize_sx =    0
  1124.         IF global.torsx < global.fromrsx THEN
  1125.             global.resize_sx = -global.resize_sx
  1126.         global.min_rsx = MIN(global.fromrsx, global.torsx)
  1127.         global.max_rsx = MAX(global.fromrsx, global.torsx)
  1128.  
  1129.         resizey = ABS(global.torsy - global.fromrsy)
  1130.         IF global.count > 1 THEN
  1131.             global.resize_sy = (resizey * global.resizes) / (global.count - 1)
  1132.         ELSE
  1133.             global.resize_sy =    0
  1134.         IF global.torsy < global.fromrsy THEN
  1135.             global.resize_sy = -global.resize_sy
  1136.         global.min_rsy = MIN(global.fromrsy, global.torsy)
  1137.         global.max_rsy = MAX(global.fromrsy, global.torsy)
  1138.     END
  1139.     ELSE
  1140.         global.do_resize = 0
  1141.     global.resize_x = global.fromrsx
  1142.     global.resize_y = global.fromrsy
  1143.  
  1144.     global.do_transf = global.do_rot | global.rot_ang ~= 0 |,
  1145.                        global.do_shear | global.shear_x ~= 0 | global.shear_y ~= 0 |,
  1146.                        global.do_resize | global.resize_x ~= 1000000 | global.resize_y ~= 1000000
  1147.  
  1148.     RETURN
  1149.  
  1150.  
  1151.  
  1152.  
  1153. GetStep: PROCEDURE EXPOSE global.
  1154.  
  1155.     IF global.points = 2 THEN DO
  1156.         xp = TRUNC(global.line_xp + 0.5)
  1157.         yp = TRUNC(global.line_yp + 0.5)
  1158.     END
  1159.     ELSE DO
  1160.         point = TRUNC(global.point_p + 0.5)
  1161.         xp = global.xcoord.point
  1162.         yp = global.ycoord.point
  1163.     END
  1164.  
  1165.     RETURN xp yp
  1166.  
  1167.  
  1168.  
  1169.  
  1170. PreviewStep: PROCEDURE EXPOSE global.
  1171.  
  1172.     pos = ARG(1)
  1173.     IF global.do_transf THEN DO
  1174.         w = global.bshw
  1175.         h = global.bshh
  1176.         hx = global.bshhx
  1177.         hy = global.bshhy
  1178.  
  1179.         r.0.x = 0
  1180.         r.0.y = 0
  1181.         r.1.x = w - 1
  1182.         r.1.y = 0
  1183.         r.2.x = w - 1
  1184.         r.2.y = h - 1
  1185.         r.3.x = 0
  1186.         r.3.y = h - 1
  1187.  
  1188.         r.4.x = 0
  1189.         r.4.y = h % 2
  1190.         r.5.x = w % 2
  1191.         r.5.y = 0
  1192.         r.6.x = w - 1
  1193.         r.6.y = h % 2
  1194.  
  1195.         IF global.rot_ang ~= 0 THEN DO
  1196.             GetEllipsePoint 0 0 1000 1000 TRUNC(global.rot_ang / 10 + 0.5)
  1197.             PARSE VAR RESULT px py .
  1198.             spm = px / 1000
  1199.             cpm = -(py / 1000)
  1200.  
  1201.             minx = 32000
  1202.             miny = 32000
  1203.             maxx = -32000
  1204.             maxy = -32000
  1205.             DO pt = 0 TO 6
  1206.                 rptx = r.pt.x * cpm - r.pt.y * spm
  1207.                 rpty = r.pt.x * spm + r.pt.y * cpm
  1208.                 r.pt.x = TRUNC(rptx + 0.5 * SIGN(rptx))
  1209.                 r.pt.y = TRUNC(rpty + 0.5 * SIGN(rpty))
  1210.                 IF r.pt.x > maxx THEN maxx = r.pt.x
  1211.                 IF r.pt.y > maxy THEN maxy = r.pt.y
  1212.                 IF r.pt.x < minx THEN minx = r.pt.x
  1213.                 IF r.pt.y < miny THEN miny = r.pt.y
  1214.             END
  1215.             w = maxx - minx + 1
  1216.             h = maxy - miny + 1
  1217.  
  1218.             hx1 = hx * cpm - hy * spm
  1219.             hy1 = hx * spm + hy * cpm
  1220.             hx = TRUNC(hx1 + 0.5 * SIGN(hx1))
  1221.             hy = TRUNC(hy1 + 0.5 * SIGN(hy1))
  1222.         END
  1223.  
  1224.         IF global.shear_x ~= 0 | global.shear_y ~= 0 THEN DO
  1225.             w0 = w
  1226.             h0 = h
  1227.             shearx = TRUNC(global.shear_x + 0.5 * SIGN(global.shear_x))
  1228.             sheary = TRUNC(global.shear_y + 0.5 * SIGN(global.shear_y))
  1229.             w2 = w + ABS(shearx)
  1230.             h2 = h + ABS(sheary)
  1231.  
  1232.             minx = 32000
  1233.             miny = 32000
  1234.             DO pt = 0 TO 6
  1235.                 rptx = r.pt.x + (shearx * (r.pt.y / (h-1)))
  1236.                 rpty = r.pt.y + (sheary * (rptx / (w2-1)))
  1237.                 r.pt.x = TRUNC(rptx + 0.5 * SIGN(rptx))
  1238.                 r.pt.y = TRUNC(rpty + 0.5 * SIGN(rpty))
  1239.                 IF r.pt.x < minx THEN minx = r.pt.x
  1240.                 IF r.pt.y < miny THEN miny = r.pt.y
  1241.             END
  1242.             w = w2
  1243.             h = h2
  1244.             hx1 = hx * (w / w0) + minx
  1245.             hy1 = hy * (h / h0) + miny
  1246.             hx = TRUNC(hx1 + 0.5 * SIGN(hx1))
  1247.             hy = TRUNC(hy1 + 0.5 * SIGN(hy1))
  1248.         END
  1249.  
  1250.         IF global.resize_x ~= 1000000 | global.resize_y ~= 1000000 THEN DO
  1251.             multx = global.resize_x / 1000000
  1252.             multy = global.resize_y / 1000000
  1253.  
  1254.             DO pt = 0 TO 6
  1255.                 rptx = r.pt.x * multx
  1256.                 rpty = r.pt.y * multy
  1257.                 r.pt.x = TRUNC(rptx + 0.5 * SIGN(rptx))
  1258.                 r.pt.y = TRUNC(rpty + 0.5 * SIGN(rpty))
  1259.             END
  1260.  
  1261.             hx = TRUNC(hx * multx + 0.5 * SIGN(hx))
  1262.             hy = TRUNC(hy * multy + 0.5 * SIGN(hy))
  1263.         END
  1264.  
  1265.         PARSE VAR pos xpos ypos .
  1266.         pxseq = ''
  1267.         DO pt = 0 TO 6
  1268.             r.pt.x = xpos - hx + r.pt.x
  1269.             r.pt.y = ypos - hy + r.pt.y
  1270.             pxseq = pxseq r.pt.x r.pt.y
  1271.             IF pt = 3 | pt = 6 THEN DO
  1272.                 polypts.pt = pxseq
  1273.                 pxseq = ''
  1274.             END
  1275.         END
  1276.         Undo global.prvwundo
  1277.  
  1278.         IF ~global.add & global.prvwundo ~= 0 THEN DO
  1279.             IF global.direct = 0 THEN
  1280.                 SetFramePosition 'NEXT'
  1281.             ELSE IF global.direct = 1 THEN
  1282.                 SetFramePosition 'PREVIOUS'
  1283.         END
  1284.  
  1285.         DrawPolygon '"'polypts.3'" COMPLEMENT'
  1286.         DrawPolygon '"'polypts.6'" COMPLEMENT'
  1287.         global.prvwundo = 2
  1288.     END
  1289.     ELSE DO
  1290.         Undo global.prvwundo
  1291.  
  1292.         IF ~global.add & global.prvwundo ~= 0 THEN DO
  1293.             IF global.direct = 0 THEN
  1294.                 SetFramePosition 'NEXT'
  1295.             ELSE IF global.direct = 1 THEN
  1296.                 SetFramePosition 'PREVIOUS'
  1297.         END
  1298.  
  1299.         PutBrush pos
  1300.         global.prvwundo = 1
  1301.     END
  1302.  
  1303.     RETURN
  1304.  
  1305.  
  1306.  
  1307.  
  1308. NextStep: PROCEDURE EXPOSE global.
  1309.  
  1310.     IF global.points = 2 THEN DO
  1311.         global.line_xp = global.line_xp + global.line_xs
  1312.         global.line_yp = global.line_yp + global.line_ys
  1313.     END
  1314.     ELSE
  1315.         global.point_p = global.point_p + global.point_s
  1316.  
  1317.     IF global.do_rot THEN
  1318.         global.rot_ang = global.rot_ang + global.rot_step
  1319.  
  1320.     IF global.do_shear THEN DO
  1321.         global.shear_x = global.shear_x + global.shear_sx
  1322.         IF global.shear_sx > 0 THEN DO
  1323.             IF global.shear_x > global.max_shx THEN DO
  1324.                 excd = global.shear_x - global.max_shx
  1325.                 global.shear_x = global.max_shx - excd
  1326.                 global.shear_sx = -global.shear_sx
  1327.             END
  1328.         END
  1329.         ELSE DO
  1330.             IF global.shear_x < global.min_shx THEN DO
  1331.                 excd = global.min_shx - global.shear_x
  1332.                 global.shear_x = global.min_shx + excd
  1333.                 global.shear_sx = -global.shear_sx
  1334.             END
  1335.         END
  1336.  
  1337.         global.shear_y = global.shear_y + global.shear_sy
  1338.         IF global.shear_sy > 0 THEN DO
  1339.             IF global.shear_y > global.max_shy THEN DO
  1340.                 excd = global.shear_y - global.max_shy
  1341.                 global.shear_y = global.max_shy - excd
  1342.                 global.shear_sy = -global.shear_sy
  1343.             END
  1344.         END
  1345.         ELSE DO
  1346.             IF global.shear_y < global.min_shy THEN DO
  1347.                 excd = global.min_shy - global.shear_y
  1348.                 global.shear_y = global.min_shy + excd
  1349.                 global.shear_sy = -global.shear_sy
  1350.             END
  1351.         END
  1352.     END
  1353.  
  1354.     IF global.do_resize THEN DO
  1355.         global.resize_x = global.resize_x + global.resize_sx
  1356.         IF global.resize_sx > 0 THEN DO
  1357.             IF global.resize_x > global.max_rsx THEN DO
  1358.                 excd = global.resize_x - global.max_rsx
  1359.                 global.resize_x = global.max_rsx - excd
  1360.                 global.resize_sx = -global.resize_sx
  1361.             END
  1362.         END
  1363.         ELSE DO
  1364.             IF global.resize_x < global.min_rsx THEN DO
  1365.                 excd = global.min_rsx - global.resize_x
  1366.                 global.resize_x = global.min_rsx + excd
  1367.                 global.resize_sx = -global.resize_sx
  1368.             END
  1369.         END
  1370.  
  1371.         global.resize_y = global.resize_y + global.resize_sy
  1372.         IF global.resize_sy > 0 THEN DO
  1373.             IF global.resize_y > global.max_rsy THEN DO
  1374.                 excd = global.resize_y - global.max_rsy
  1375.                 global.resize_y = global.max_rsy - excd
  1376.                 global.resize_sy = -global.resize_sy
  1377.             END
  1378.         END
  1379.         ELSE DO
  1380.             IF global.resize_y < global.min_rsy THEN DO
  1381.                 excd = global.min_rsy - global.resize_y
  1382.                 global.resize_y = global.min_rsy + excd
  1383.                 global.resize_sy = -global.resize_sy
  1384.             END
  1385.         END
  1386.     END
  1387.  
  1388.     RETURN
  1389.  
  1390.  
  1391.  
  1392.  
  1393. PreviewBegin: PROCEDURE EXPOSE global.
  1394.  
  1395.     IF ~global.do_transf THEN DO
  1396.         SetCurrentBrush global.savebsh
  1397.         SetPaintMode global.savepmode
  1398.         SetPen 'FOREGROUND' global.savepen
  1399.     END
  1400.     GetFramePosition
  1401.     IF RC = 0 THEN
  1402.         global.savefrpos = RESULT
  1403.     ELSE
  1404.         global.savefrpos = 0
  1405.     global.prvwundo = 0
  1406.  
  1407.     RETURN
  1408.  
  1409.  
  1410.  
  1411.  
  1412. PreviewEnd: PROCEDURE EXPOSE global.
  1413.  
  1414.     Undo global.prvwundo
  1415.     IF ~global.do_transf THEN DO
  1416.         IF global.savebshfr > 1 THEN
  1417.             SetBrushAttributes 'FRAMEPOSITION' global.savebshfp
  1418.         SetCurrentBrush 'RECTANGULAR WIDTH 1 HEIGHT 1'
  1419.         SetPen 'FOREGROUND' global.xorpen
  1420.     END
  1421.     IF global.savefrpos > 0 THEN
  1422.         SetFramePosition global.savefrpos
  1423.  
  1424.     RETURN
  1425.  
  1426.  
  1427.  
  1428.  
  1429. PreviewPath: PROCEDURE EXPOSE global.
  1430.  
  1431.     IF global.points = 0 THEN DO
  1432.         RequestNotify 'TITLE "'global.txt_title_pview'" PROMPT "'global.txt_err_nopath'"'
  1433.         RETURN
  1434.     END
  1435.  
  1436.     CALL InitStep
  1437.  
  1438.     IF global.do_transf THEN DO
  1439.         IF WORD(global.savebsh, 1) ~= 'BRUSH' THEN DO
  1440.             RequestNotify 'TITLE "'global.txt_title_pview'" PROMPT "'global.txt_err_nocbsh'"'
  1441.             RETURN
  1442.         END
  1443.         IF global.tbshnum = 0 THEN DO
  1444.             RequestNotify 'TITLE "'global.txt_title_pview'" PROMPT "'global.txt_err_notbsh'"'
  1445.             RETURN
  1446.         END
  1447.     END
  1448.     LockGUI
  1449.     CALL XorPath
  1450.     CALL PreviewBegin
  1451.  
  1452.     DO cnt = 1 to global.count
  1453.         CALL PreviewStep( GetStep() )
  1454.         Wait 'TIME 200'
  1455.         CALL NextStep()
  1456.     END
  1457.     Wait 'TIME 200'
  1458.  
  1459.     CALL PreviewEnd
  1460.     CALL XorPath
  1461.     UnlockGUI
  1462.  
  1463.     RETURN
  1464.  
  1465.  
  1466.  
  1467.  
  1468. DrawStep: PROCEDURE EXPOSE global.
  1469.  
  1470.     pos = ARG(1)
  1471.     IF global.do_transf THEN DO
  1472.         SetCurrentBrush 'BRUSH' global.tbshnum
  1473.         IF RC ~= 0 THEN
  1474.             RETURN 0
  1475.         CopyBrush global.savebshnum 'NOFRAMES'
  1476.         IF RC ~= 0 THEN
  1477.             RETURN 0
  1478.  
  1479.         IF global.rot_ang ~= 0 THEN DO
  1480.             RotateBrush TRUNC(global.rot_ang / 10 + 0.5) 'NOPROGRESS'
  1481.             IF RC ~= 0 THEN
  1482.                 RETURN 0
  1483.         END
  1484.         IF global.shear_x ~= 0 | global.shear_y ~= 0 THEN DO
  1485.             shearx = TRUNC(global.shear_x + 0.5 * SIGN(global.shear_x))
  1486.             sheary = TRUNC(global.shear_y + 0.5 * SIGN(global.shear_y))
  1487.             ShearBrush shearx sheary 'NOPROGRESS'
  1488.             IF RC ~= 0 THEN
  1489.                 RETURN 0
  1490.         END
  1491.  
  1492.         IF global.resize_x ~= 1000000 | global.resize_y ~= 1000000 THEN DO
  1493.             GetBrushAttributes 'WIDTH'
  1494.             w = TRUNC(RESULT * (global.resize_x / 1000000) + 0.5)
  1495.             GetBrushAttributes 'HEIGHT'
  1496.             h = TRUNC(RESULT * (global.resize_y / 1000000) + 0.5)
  1497.             IF w < 1 THEN w = 1
  1498.             IF h < 1 THEN h = 1
  1499.             SetBrushAttributes 'WIDTH' w 'HEIGHT' h 'NOPROGRESS'
  1500.             IF RC ~= 0 THEN
  1501.                 RETURN 0
  1502.         END
  1503.         SetPaintMode global.savepmode
  1504.         SetPen 'FOREGROUND' global.savepen
  1505.         PutBrush pos
  1506.         FreeBrush 'FORCE'
  1507.         SetCurrentBrush global.savebsh
  1508.         IF RC ~= 0 THEN
  1509.             RETURN 0
  1510.  
  1511.         IF global.savebshfr > 1 THEN DO    /* get next frame */
  1512.             PutBrush '-1000 -1000'
  1513.             Undo
  1514.         END
  1515.     END
  1516.     ELSE
  1517.         PutBrush pos
  1518.  
  1519.     RETURN 1
  1520.  
  1521.  
  1522.  
  1523.  
  1524. DrawIt: PROCEDURE EXPOSE global.
  1525.  
  1526.     IF global.points = 0 THEN DO
  1527.         RequestNotify 'TITLE "'global.txt_title_draw'" PROMPT "'global.txt_err_nopath'"'
  1528.         RETURN 0
  1529.     END
  1530.  
  1531.     CALL InitStep
  1532.  
  1533.     IF global.do_transf THEN DO
  1534.         IF WORD(global.savebsh, 1) ~= 'BRUSH' THEN DO
  1535.             RequestNotify 'TITLE "'global.txt_title_draw'" PROMPT "'global.txt_err_nocbsh'"'
  1536.             RETURN 0
  1537.         END
  1538.         IF global.tbshnum = 0 THEN DO
  1539.             RequestNotify 'TITLE "'global.txt_title_draw'" PROMPT "'global.txt_err_notbsh'"'
  1540.             RETURN 0
  1541.         END
  1542.     END
  1543.  
  1544.     LockGUI
  1545.     CALL XorPath
  1546.     global.pathdisp = 0
  1547.     SetCurrentBrush global.savebsh
  1548.     SetPaintMode global.savepmode
  1549.     SetPen 'FOREGROUND' global.savepen
  1550.  
  1551.     IF global.add THEN DO
  1552.         GetFramePosition
  1553.         IF RC = 0 THEN
  1554.             frpos = RESULT
  1555.         ELSE
  1556.             frpos = 0
  1557.         AddFrames global.count
  1558.         IF global.direct = 1 THEN
  1559.             SetFramePosition frpos + global.count
  1560.     END
  1561.  
  1562.     DO cnt = 1 to global.count
  1563.         IF ~DrawStep( GetStep() ) THEN DO
  1564.             RequestNotify 'TITLE "'global.txt_title_draw'" PROMPT "'global.txt_err_notmem'"'
  1565.             LEAVE
  1566.         END
  1567.         IF global.direct = 0 THEN
  1568.             SetFramePosition 'NEXT'
  1569.         ELSE IF global.direct = 1 THEN
  1570.             SetFramePosition 'PREVIOUS'
  1571.         CALL NextStep()
  1572.     END
  1573.  
  1574.     IF global.savebshfr > 1 THEN
  1575.         SetBrushAttributes 'FRAMEPOSITION' global.savebshfp
  1576.     SetCurrentBrush 'RECTANGULAR WIDTH 1 HEIGHT 1'
  1577.     SetPen 'FOREGROUND' global.xorpen
  1578.     UnlockGUI
  1579.  
  1580.     RETURN 1
  1581.  
  1582.  
  1583.  
  1584.  
  1585. RotSettings: PROCEDURE EXPOSE global.
  1586.  
  1587.     Request '"'global.txt_title_brot'" ',
  1588.             '"INTSTR = ""'global.txt_gad_rotats'"", 1, 32000, 'global.rotats' ',
  1589.             ' INT10000STR = ""'global.txt_gad_fromang'"", 0, 3590000, 'global.fromang' ',
  1590.             ' INT10000STR = ""'global.txt_gad_toang'"", 0, 3590000, 'global.toang' ',
  1591.             ' CYCLE = ""'global.txt_gad_rotdir'"", 2, 'global.rotdir', ""'global.txt_gad_rotdr.0'"", ""'global.txt_gad_rotdr.1'"" "'
  1592.     IF RC = 0 THEN DO
  1593.         global.rotats = RESULT.1
  1594.         global.fromang = RESULT.2
  1595.         global.toang = RESULT.3
  1596.         global.rotdir = RESULT.4
  1597.     END
  1598.  
  1599.     RETURN
  1600.  
  1601.  
  1602.  
  1603.  
  1604. ShearSettings: PROCEDURE EXPOSE global.
  1605.  
  1606.     Request '"'global.txt_title_bshr'" ',
  1607.             '"INTSTR = ""'global.txt_gad_shears'"", 1, 32000, 'global.shears' ',
  1608.             ' INTSTR = ""'global.txt_gad_fromshx'"", -32000, 32000, 'global.fromshx' ',
  1609.             ' INTSTR = ""'global.txt_gad_toshx'"", -32000, 32000, 'global.toshx' ',
  1610.             ' INTSTR = ""'global.txt_gad_fromshy'"", -32000, 32000, 'global.fromshy' ',
  1611.             ' INTSTR = ""'global.txt_gad_toshy'"", -32000, 32000, 'global.toshy' "'
  1612.     IF RC = 0 THEN DO
  1613.         global.shears  = RESULT.1
  1614.         global.fromshx = RESULT.2
  1615.         global.toshx   = RESULT.3
  1616.         global.fromshy = RESULT.4
  1617.         global.toshy   = RESULT.5
  1618.     END
  1619.  
  1620.     RETURN
  1621.  
  1622.  
  1623.  
  1624.  
  1625. ResizeSettings: PROCEDURE EXPOSE global.
  1626.  
  1627.     Request '"'global.txt_title_bresz'" ',
  1628.             '"INTSTR = ""'global.txt_gad_resizes'"", 1, 32000, 'global.resizes' ',
  1629.             ' INT10000STR = ""'global.txt_gad_fromrsx'"", 00100, 320000000, 'global.fromrsx' ',
  1630.             ' INT10000STR = ""'global.txt_gad_torsx'"", 00100, 320000000, 'global.torsx' ',
  1631.             ' INT10000STR = ""'global.txt_gad_fromrsy'"", 00100, 320000000, 'global.fromrsy' ',
  1632.             ' INT10000STR = ""'global.txt_gad_torsy'"", 00100, 320000000, 'global.torsy' "'
  1633.     IF RC = 0 THEN DO
  1634.         global.resizes = RESULT.1
  1635.         global.fromrsx = RESULT.2
  1636.         global.torsx   = RESULT.3
  1637.         global.fromrsy = RESULT.4
  1638.         global.torsy   = RESULT.5
  1639.     END
  1640.  
  1641.     RETURN
  1642.  
  1643.  
  1644.  
  1645.  
  1646. DisplayData: PROCEDURE EXPOSE global.
  1647.  
  1648.     direct = global.direct
  1649.     add = global.add
  1650.     rotdir = global.rotdir
  1651.  
  1652.     str = COMPRESS(global.txt_gad_count, '_') global.count || '0A'x ||,
  1653.           COMPRESS(global.txt_gad_direct, '_') global.txt_gad_dirct.direct || '0A'x ||,
  1654.           COMPRESS(global.txt_gad_add, '_') global.txt_gad_addf.add || '0A'x ||,
  1655.           '0A'x ||,
  1656.           COMPRESS(global.txt_gad_rotats, '_') global.rotats || '0A'x ||,
  1657.           COMPRESS(global.txt_gad_fromang, '_') (global.fromang / 10000) || '0A'x ||,
  1658.           COMPRESS(global.txt_gad_toang, '_') (global.toang / 10000) || '0A'x ||,
  1659.           COMPRESS(global.txt_gad_rotdir, '_') global.txt_gad_rotdr.rotdir || '0A'x ||,
  1660.           '0A'x ||,
  1661.           COMPRESS(global.txt_gad_shears, '_') global.shears || '0A'x ||,
  1662.           COMPRESS(global.txt_gad_fromshx, '_') global.fromshx || '0A'x ||,
  1663.           COMPRESS(global.txt_gad_toshx, '_') global.toshx || '0A'x ||,
  1664.           COMPRESS(global.txt_gad_fromshy, '_') global.fromshy || '0A'x ||,
  1665.           COMPRESS(global.txt_gad_toshy, '_') global.toshy || '0A'x ||,
  1666.           '0A'x ||,
  1667.           COMPRESS(global.txt_gad_resizes, '_') global.resizes || '0A'x ||,
  1668.           COMPRESS(global.txt_gad_fromrsx, '_') (global.fromrsx / 10000) || '0A'x ||,
  1669.           COMPRESS(global.txt_gad_torsx, '_') (global.torsx / 10000) || '0A'x ||,
  1670.           COMPRESS(global.txt_gad_fromrsy, '_') (global.fromrsy / 10000) || '0A'x ||,
  1671.           COMPRESS(global.txt_gad_torsy, '_') (global.torsy / 10000) || '0A'x
  1672.  
  1673.     pos = 1
  1674.     DO FOREVER
  1675.         pos = INDEX(str, '"', pos)
  1676.         IF pos = 0 THEN
  1677.             BREAK
  1678.         str = INSERT('"', str, pos)
  1679.         pos = pos + 2
  1680.     END
  1681.  
  1682.     IF global.points > 0 THEN DO
  1683.         IF global.points = 2 THEN
  1684.             ptype = 1
  1685.         ELSE
  1686.             ptype = 0
  1687.  
  1688.         str = str ||,
  1689.               '0A'x ||,
  1690.               global.txt_msg_points global.points global.txt_msg_ptype.ptype || '0A'x ||,
  1691.               '0A'x
  1692.  
  1693.         DO point = 0 FOR global.points
  1694.             str = str || global.xcoord.point','global.ycoord.point || '0A'x
  1695.         END
  1696.     END
  1697.     RequestNotify '"'global.txt_title_data'" "'str'" SCROLL'
  1698.  
  1699.     RETURN
  1700.  
  1701.  
  1702.  
  1703.  
  1704. XorPath: PROCEDURE EXPOSE global.
  1705.  
  1706.     IF global.points > 0 THEN DO
  1707.         xp = global.xcoord.0
  1708.         yp = global.ycoord.0
  1709.         last = global.points - 1
  1710.  
  1711.         DO point = 1 TO last
  1712.             IF point = 1 THEN
  1713.                 nfp = ''
  1714.             ELSE
  1715.                 nfp = 'NOFIRSTPIXEL'
  1716.             DrawLine xp yp global.xcoord.point global.ycoord.point 'COMPLEMENT' nfp
  1717.  
  1718.             xp = global.xcoord.point
  1719.             yp = global.ycoord.point
  1720.         END
  1721.     END
  1722.  
  1723.     RETURN
  1724.  
  1725.  
  1726.  
  1727.  
  1728. Cleanup: PROCEDURE EXPOSE global.
  1729.  
  1730.     IF global.pathdisp THEN DO
  1731.         LockGUI
  1732.         CALL XorPath
  1733.         UnlockGUI
  1734.     END
  1735.  
  1736.     RETURN
  1737.  
  1738.  
  1739.  
  1740.  
  1741. Break_C:
  1742.  
  1743.     CALL Cleanup
  1744.  
  1745.     LockGUI
  1746.     SetPen 'FOREGROUND' global.savepen
  1747.     SetCurrentBrush global.savebsh
  1748.     SetPaintMode global.savepmode
  1749.     IF global.savebshfr > 1 THEN
  1750.         SetBrushAttributes 'FRAMEPOSITION' global.savebshfp
  1751.     Set '"BARS='savebars'"'
  1752.     Set '"GCLIP='saveclip'"'
  1753.     Set '"COORD='savecoord'"'
  1754.     EnableTools
  1755.     UnlockGUI
  1756.  
  1757.     RETURN
  1758.